{% from "wiki/includes/flag_form.html" import flag_form with context %}

<div class="author" xmlns="http://www.w3.org/1999/html"
     xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
  <a class="avatar" href="{{ profile_url(post.author) }}">
    <img src="{{ profile_avatar(post.author) }}" height="45" width="45" alt="{{ display_name(post.author) }}"/>
  </a>
  <a class="author-name" href="{{ profile_url(post.author) }}">{{ display_name(post.author) }}</a>

  <ul>
    <li>{{ private_message(post.author) }}</li>
    {% if post.id and not thread.is_locked and
      has_perm_or_owns('forums_forum.post_edit_forum', post, forum, 'author') %}
      <li><a href="{{ url('forums.edit_post', forum.slug, thread.id, post.id) }}">{{ _('Edit this post') }}</a></li>
    {% endif %}
    {% if post.id and has_perm('forums_forum.post_delete_forum', forum) %}
      <li><a href="{{ url('forums.delete_post', forum.slug, thread.id, post.id) }}">{{ _('Delete this post') }}</a></li>
    {% endif %}
  </ul>

  {# L10n: {0} is the number of posts. #}
  <span class="posts">{{ ngettext('1 post', '{0} posts', post.author_post_count)|f(post.author_post_count) }}</span>
  <div class="post-actions">

  </div>
</div>
<div class="content">
  {{ post.content_parsed }}
</div>
<div class="content-raw">{{ post.content }}</div>
<div class="info">
  <div>
    {% if post.id and user.is_authenticated() and not thread.is_locked and forum.allows_posting_by(user) %}
    <span class="post-action">
      <a class="reply" data-post="{{ post.id }}" href="#thread-reply">{{ _('Quote') }}</a>
    </span>
  {% endif %}
    {{ datetimeformat(post.created, format='longdatetime') }}
    <a href="#post-{{ post.id }}" class="permalink" title="{{ _('Link to this post.') }}">#</a>
    {% if post.id %}
      {{ flag_form(url('forums.flag_post', post.thread.forum.slug, post.thread.id, post.id)) }}
    {% endif %}
  </div>
  {% if post.updated_by %}
    {{ _('Modified by {name} on {datetime}')|fe(name=display_name(post.updated_by), datetime=datetimeformat(post.updated, format='longdatetime')) }}
  {% endif %}
</div>
